<h1>Komentarze</h1>

{mainoptions title="Filtry"}
<form action="{url Comments=Index }" method="post">
	<table cellspacing="0" cellpadding="0" border="0" class="commonTable">
		<tr>
			<th>Nowe komentarze:</th>
			<td><input type="checkbox" name="new" value="1" {if $filter.new gt 0}checked=checked{/if} /></td>
		</tr>
		<tr>
			<th>Typ komentarzy:</th>
			<td>
				<select name="type">
						<option value="0">Wszystkie</option>
					{foreach from=$types key=k item=v  }
						<option value="{$k}" {if $selected_type == $k}selected="selected"{/if}>{$v}</option>
					{/foreach}
				</select>
			</td>
			</th>
		</tr>
		</table>
		<p align="right">
			<input type="submit" value="Szukaj" />
		</p>
</form>
{/mainoptions}
{mainoptions title="Lista"}
<table cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td>{tables label="Lp. [id]" tid=comments_table o=id}</td>
		<td>{tables label="Tytuł" tid=comments_table o=title}</td>
		<td>{tables label="Użytkownik" tid=comments_table o=user}</td>
		<td>{tables label="Typ" tid=comments_table o=type}</td>
		<th class="noSort"></th>

	</tr>
	{foreach from=$list item=obj name=comments_table}
		{assign var=usr value=`$obj->user`}
		<tr class="{$obj->getCssClass()}">
			<td>{tables type='lp' tid='comments_table' iteration=$smarty.foreach.comments_table.iteration} [{$obj->getId()}]</td>
			<td><a href="{url comments=edit id=$obj->getId()}">{$obj->getTitle()|wordwrap:70:"\n":true}<a/></td>
			<td>{$usr->getEmail()}</td>
			<td>{$obj->getTypeName()}</td>

			<td>
				<a href="{url comments=edit id=$obj->getId()}" class="edit"> edytuj</a>

				<a onclick="if(!confirm('Czy na pewno chcesz usunąć ten element?'))return false;" href="{url comments=remove id=$obj->getId()}" class="delete"> usuń</a>
			</td>
		</tr>
	{/foreach}
	<tr class="selAllRow">
		<td colspan="2">
			<div class="pager">
				{tables type='pagination' tid='comments_table' all_count=$c}
				{tables type='on_page' tid='comments_table'}
			</div>
		</td>
	</tr>
</table>
{/mainoptions}